package mahmoud.utils;

import java.util.Comparator;

public class TermScore implements Comparable<TermScore>
{
	TermScore(String xt, double xtf,double xidf, double xtfidf)
	{
		TERM = xt;
		tf = xtf;
		idf = xidf;
		TFIDF = xtfidf;
		DocCount =0;
		
	}
	TermScore(String xt, double xtf,double xidf, double xtfidf, int DC)
	{
		TERM = xt;
		tf = xtf;
		idf = xidf;
		TFIDF = xtfidf;
		DocCount =DC;
		
	}
	public String TERM;
	public double tf;
	public double idf;
	public double TFIDF;
	public int DocCount;
	@Override
	public int compareTo(TermScore TS2) {
		// TODO Auto-generated method stub
		if(this.TFIDF > TS2.TFIDF)return -1;
		if(this.TFIDF < TS2.TFIDF)return 1;
		return 0;
	}

	
}

class TermScoreComparator implements Comparator<TermScore>
{

	@Override
	public int compare(TermScore TS1, TermScore TS2) 
	{
		// TODO Auto-generated method stub
		if(TS1.TFIDF > TS2.TFIDF)return -1;
		if(TS1.TFIDF < TS2.TFIDF)return 1;
		return 0;
	}
	
}